//
//  GDMBasicNavController.swift
//  SinaWeibo
//
//  Created by mac on 15/12/3.
//  Copyright © 2015年 mac. All rights reserved.
//

import UIKit

//重写这个控制器的原因就是要统一的管理，nav上的内容，和tabBar上的内容
class GDMBasicNavController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func pushViewController(viewController: UIViewController, animated: Bool) {
        
        if childViewControllers.count != 0{
            
            viewController.hidesBottomBarWhenPushed = true
            
            viewController.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain, target: self, action: "close")
            
        }
        
        super.pushViewController(viewController, animated: true)
        
    }

    @objc private func colse() {
        
        navigationController?.popViewControllerAnimated(true)
    }
    
}
